package com.cweb.admin.model.bbs.bbs_comment_info.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.cweb.admin.model.sys.sys_user_info.entity.SysUserInfo;
import com.cweb.framework.base.entity.BaseMybatisModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 论坛-评论信息
 *
 * @author changfan
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class BbsCommentInfo extends BaseMybatisModel {

    private static final long serialVersionUID = 1L;

    /**
     * 订单id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户uid
     */
    @TableField(value = "`user_id`")
    private Long userId;

    /**
     * 文章id
     */
    @TableField(value = "`article_id`")
    private Long articleId;

    /**
     * 评论内容
     */
    @TableField(value = "`content`")
    private String content;

    /**
     * 回复评论id
     */
    @TableField(value = "`parent`")
    private Long parent;

    /**
     * 评论回复数量
     */
    @TableField(value = "`reply_num`")
    private Integer replyNum;

    /**
     * 评论回复用户id
     */
    @TableField(value = "`reply_user_id`")
    private Long replyUserId;

    /**
     * 点赞数
     */
    @TableField(value = "`like_num`")
    private Integer likeNum;

    /**
     * 状态 0 正常
     */
    @TableField(value = "`status`", select = false)
    private Integer status;

    /**
     * 更新时间 自动记录更新时间
     */
    @TableField(value = "`update_time`", select = false)
    private Date updateTime;

    /**
     * 创建时间 默认为当前时间
     */
    @TableField(value = "`create_time`")
    private Date createTime;

    // 追加
    // 查询时是否按热门排序
    @TableField(exist = false)
    private boolean hot;
    // 回复信息
    @TableField(exist = false)
    private Object reply;
    // 用户信息
    @TableField(exist = false)
    private SysUserInfo user;
    // 回复用户信息
    @TableField(exist = false)
    private SysUserInfo replyUser;

    /**
     * 备注
     */
    @TableField(value = "`remark`", select = false)
    private String remark;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
